**************************************************
**************************************************
**************************************************
**************************************************
**************************************************
**************************************************
**************************************************

****This do-file reproduces individual level figures and tables in the Online Appendix. 

*Rodon, Toni; Guinjoan, Marc. Beaten ballots: Political participation dynamics amidst police interventions, Political Science Research & Methods.

clear all
capture cd "INCLUDE YOUR PATH HERE" 

log using "appendixB", text replace

*Variables are recoded executing the following command.
quiet do recodes_CEO863

***Table A2:  Summary statistics (individual-level data)
quiet logit vote1o c.log_distance log_distance_sq ${controls}, cluster(PROV)
sum vote1o raided_mun number_policemen_polling log_distance decisionvote  origin log_population17 barcelona  female  if e(sample)

tab ins if e(sample)
tab party_type if e(sample)
tab age if e(sample)
tab education if e(sample)


***Table J.1: The effect of police violence on turnout 
eststo clear
eststo: logit vote1o raided_mun ${controls}, cluster(PROV)
eststo: logit vote1o c.number_policemen_polling ${controls}, cluster(PROV)
eststo: logit vote1o c.log_distance log_distance_sq ${controls}, cluster(PROV)

esttab using "TableJ1.html", title("Table J.1: The effect of police violence on turnout") mtitles ("Police intervention" "N. Police officers" "Distance") label nonumbers coeflabels(_cons "Constant" ) nogaps starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001) drop(origin *.ins log_population17 *.barcelona *.age *.female *.education) indicate("Controls=*party_type") b(3) se(3) eqlabels(none) replace


****Table K.1:  Change in identity before and after the Referendum by raided and non-raidedmunicipality
reg ins i.post1o##i.raided_mun  ${controls_noins} i.language, cluster(PROV)
margins, at(post1o=(0 1) raided_mun=(0 1))
marginsplot, title("") xtitle("Survey timing", height(6)) ytitle("Mean national-regional identification", height(6)) xlabel(0 `""  July" "  2017""' 1 `""November       " "2017       ""') legend(order(3 "Municipality not raided" 4 "Raided municipality")) name(FigureK1, replace) scale(0.9)

graph export "FigureK1.pdf", replace

graph close
log close
